package cn.shit;

public class TestThread {
    public static Runnable fuck() {
        return () -> {
            Thread.yield();
            while (!Thread.currentThread().isInterrupted())
                System.out.println("Fuck in...");
        };
    }

    public static void main(String[] args) throws InterruptedException {
        Thread f = new Thread(fuck());
        f.start();

        for (int i = 0; i < 10; i++) {
            Thread.sleep(1000);
            System.out.println("...");
        }
        f.interrupt();
        System.out.println("had called interrupt...");

    }
}
